Skip to content

Add 1C cluster monitoring via RAS/RAC for Zabbix - #27

Open
gpas45 wants to merge 4 commits into
mainfrom
claude/ras-implementation-analysis-fyf1jb
Open

Add 1C cluster monitoring via RAS/RAC for Zabbix#27
gpas45 wants to merge 4 commits into
mainfrom
claude/ras-implementation-analysis-fyf1jb

Conversation

@gpas45

@gpas45 gpas45 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a complete monitoring solution for 1C:Enterprise 8.3 clusters in Zabbix using the RAS/RAC administration API instead of COM+ components. It ports the monitoring approach from the Infostart article to use the native RAS server and RAC command-line client.

Key Changes

  • 1c_cluster_ras.ps1 — Cross-platform PowerShell collector script that:

    • Queries RAS/RAC for cluster, server, process, session, connection, license, and infobase data
    • Outputs a unified JSON structure compatible with the original COM+-based approach
    • Supports four modes: json (master item), discovery.ib, discovery.process, discovery.server
    • Automatically locates rac.exe (Windows) or rac (Linux) from standard installation paths
    • Works with both Windows PowerShell 5.1 and PowerShell 7+ on Linux
  • template_1c_cluster_ras.yaml — Zabbix 6.0 template with:

    • Master item onecras.json for single RAS query per interval
    • 12 dependent items extracting cluster metrics via JSONPath (sessions, connections, users, licenses, etc.)
    • 3 LLD rules for dynamic discovery of infobases, working processes, and working servers
    • Item prototypes for per-resource metrics (memory, connections, sessions)
    • Trigger prototypes for high memory usage and excessive PROF licenses
    • Configurable macros for RAS server, cluster credentials, and thresholds
  • userparameter_1c_ras.conf — Zabbix agent configuration for Windows with UserParameter definitions

  • userparameter_1c_ras_linux.conf — Zabbix agent configuration for Linux (requires PowerShell 7+)

  • README.md — Comprehensive documentation covering:

    • Advantages of RAS/RAC over COM+ (cross-platform, no registration, native PID support)
    • Mapping of COM object properties to RAC commands
    • Installation steps for Windows and Linux
    • Zabbix monitoring architecture explanation
    • Limitations and platform-specific considerations

Notable Implementation Details

  • Single master item approach: One RAS query per interval returns all cluster data as JSON, reducing API calls compared to per-metric queries
  • Automatic rac discovery: Script searches PATH first, then standard installation directories (%ProgramFiles%\1cv8 on Windows, /opt/1cv8 etc. on Linux)
  • License filtering: PROF licenses are counted separately from CORP/basic licenses using configurable regex pattern
  • Process metrics enrichment: Top sessions per process are identified by memory, CPU time, and database processing time
  • Cross-platform compatibility: Single PowerShell script works on both Windows and Linux with automatic platform detection
  • No registry hacks needed: Unlike the original approach, no need to modify ProcessNameFormat registry key since RAC provides PID directly

https://claude.ai/code/session_015DgGNtAoQ1EfNYNzeVqwJ2

claude added 4 commits July 12, 2026 13:49
Реализация функционала статьи «Мониторинг кластера 1С 8.3 в Zabbix»
на штатном интерфейсе администрирования (ras.exe/rac.exe) вместо
косвенного сбора средствами ОС.

- 1c_cluster_ras.ps1: коллектор (json-мастер-айтем, LLD инфобаз и процессов)
- userparameter_1c_ras.conf: UserParameter'ы Zabbix-агента
- README: разбор подхода статьи, соответствие метрик командам RAC, установка

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DgGNtAoQ1EfNYNzeVqwJ2
После изучения полного текста статьи «Мониторинг кластера 1С 8.3 в Zabbix»:
источник в оригинале — COM+ (V83.COMConnector), а RAS/RAC заявлен автором как
план развития. Коллектор теперь отдаёт JSON той же структуры (cluster /
workingservers / processes / bases.list) на данных RAC.

- cluster info: параметры кластера (память, отказоустойчивость, порты и т.д.)
- сводка сеансов по app-id (клиенты, WS, HTTP, фоновые, COM, web)
- лицензии ПРОФ/КОРП (license list, настраиваемый -CorpLicensePattern)
- рабочие серверы (server list) + LLD discovery.server
- rphost: top-сессии по памяти/CPU/времени СУБД, users/sessions
- базы: сессии, пользователи, регламентные reg000
- README: маппинг COM->RAC по 4 блокам, что остаётся на стороне ОС

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DgGNtAoQ1EfNYNzeVqwJ2
- 1c_cluster_ras.ps1: поиск rac (rac.exe/rac) через PATH и каталоги
  установки для Windows и Linux; $IsWindows-детект; безопасный OutputEncoding.
  Один и тот же скрипт под Windows PowerShell 5.1 и pwsh 7+ на Linux.
- userparameter_1c_ras.conf / _linux.conf: параметризованные ключи [*]
  с передачей RAS-сервера и учётки из макросов.
- template_1c_cluster_ras.yaml: шаблон Zabbix 6.0 — мастер-айтем onecras.json,
  зависимые элементы кластера (JSONPath), 3 правила LLD (базы/процессы/серверы)
  с прототипами и триггерами, триггеры RAS nodata и ПРОФ-лицензий.
- README: раздел кроссплатформенности, установка Windows/Linux, схема шаблона.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DgGNtAoQ1EfNYNzeVqwJ2
По просьбе: на серверах 1С под Linux PowerShell из коробки нет, поэтому
Linux-версия переписана на bash + awk без внешних зависимостей (нужен только
rac из платформы и стандартные awk/coreutils; jq/python/pwsh не требуются).

- 1c_cluster_ras.sh: новый Linux-коллектор. Парсинг вывода rac и сборка JSON
  целиком на awk; режимы json/discovery.ib/discovery.process/discovery.server;
  поиск rac через PATH и каталоги установки, RAC_PATH для override;
  CORP_LICENSE_PATTERN по умолчанию без интервалов {3} (совместимо с mawk).
  Выдаёт JSON, идентичный PS-версии, — Zabbix-шаблон общий.
- userparameter_1c_ras_linux.conf: ключи агента вызывают .sh (без pwsh).
- 1c_cluster_ras.ps1: помечен как Windows-версия (шапка), логика без изменений.
- README: раздел про две реализации, зависимости Linux, установка, ограничения.

Проверено: awk-парсер и генерация JSON прогнаны на синтетическом выводе rac
(json + все discovery + ПРОФ-лицензии), JSON валиден; shellcheck -S warning чист.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DgGNtAoQ1EfNYNzeVqwJ2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants